﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class UIManager : MonoBehaviour {

	public GameObject groupMenuShow;
	public GameObject groupMenuClose;
	public GameObject groupPen;
	public GameObject penDraw;
	public GameObject eraser;
	public GameManager gameManager;
	public Text result;
	private bool checkGroupPen = false;
	// Use this for initialization
	void Start () {
		GroupPenShow ();
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void GroupMenuShow()
	{
		groupMenuShow.SetActive (true);
		groupMenuClose.SetActive (false);

		groupMenuShow.GetComponent<Animator> ().enabled = true;
		groupMenuClose.GetComponent<Animator> ().enabled = false;
	}

	public void GroupMenuClose()
	{
		groupMenuShow.SetActive (false);
		groupMenuClose.SetActive (true);

		groupMenuShow.GetComponent<Animator> ().enabled = false;
		groupMenuClose.GetComponent<Animator> ().enabled = true;
	}

	public void GroupPenShow()
	{
		checkGroupPen = !checkGroupPen;

		penDraw.GetComponent<Image> ().color = Color.red;
		eraser.GetComponent<Image> ().color = Color.white;
		groupPen.SetActive (checkGroupPen);	
		gameManager.EnableDisableListPoint (checkGroupPen);
		gameManager.EnableDisableListDrawLine (checkGroupPen);

	}

	public void ClickPes()
	{
		gameManager.EnableDisableListPoint (true);
		gameManager.EnableDisableListDrawLine (false);
		penDraw.GetComponent<Image> ().color = Color.red;
		eraser.GetComponent<Image> ().color = Color.white;
	}

	public void ClickEraser()
	{
		gameManager.EnableDisableListPoint (false);
		gameManager.EnableDisableListDrawLine (true);
		penDraw.GetComponent<Image> ().color = Color.white;
		eraser.GetComponent<Image> ().color = Color.red;
		gameManager.ResetWhenChangeEarser ();
	}

	public void ClickTrueFasle()
	{
		gameManager.CheckTrueFasle (result);
	}


}
